<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		
		<style>
			
			div{
				
				width: 100px;
				height: 100px;
				background-color: red;
				
				margin: 2px;
			}
		</style>
	</head>
	<body>
		
		
		<div>aa</div>
		
		<p id="cba">pp</p>
		
		<div>bb</div>
		<div>cc</div>
		<div>dd</div>
		
		
		<input  type="button" id="scott" value="找在p标签之后的同胞兄弟" />
		
	</body>
	
	
	<script type="text/javascript" src="../js/jquery-1.8.2.min.js" ></script>
	
	<script>
		$('#scott').click(function(){
			
			//找同胞兄弟  重点只能找某个标签之后的同胞兄弟 之前的不算
			var divs = $('#cba~div');
			
			console.log(divs.length);
			
			
			divs.each(function(index,element){
				
				$(this).css('background-color','green');
			})
			
		});
		
		
	</script>
</html>
